import 'package:flutter_food/core/model/meal_model.dart';
import 'package:flutter_food/core/services/http_utils.dart';

class MealRequest {
  static Future<List<MealModel>> getMealData() async {
    final url = "/meal";
    final result = await HttpUtils.request(url);
    final mealArray = result['meal'];
    List<MealModel> mealList = [];
    for (var mealJson in mealArray) {
      mealList.add(MealModel.fromJson(mealJson));
    }
    return mealList;
  }
}
